From 3cb8c45972334331066cf9ded1267fc03b058af4 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Tue, 21 Oct 2025 15:37:02 +0000 Subject: [PATCH] Change BIOGRAPHY_DATA.DadPrelim to DadStatus, update views This also involves making "special" the sdb_dad_prelim code (Prelim) in DAD_STATUSES. --- .../sokwedb/tables/create/biography_data.m4 | 5 +++-- db/schemas/sokwedb/views/create/biography.m4 | 2 +- doc/src/code_tables.m4 | 3 ++- doc/src/epilog.inc.m4 | 4 ++-- doc/src/tables/biography_data.m4 | 15 ++++++++------- doc/src/views/biography.m4 | 3 ++- include/global_constants.m4 | 6 ++++++ 7 files changed, 24 insertions(+), 14 deletions(-) diff --git a/db/schemas/sokwedb/tables/create/biography_data.m4 b/db/schemas/sokwedb/tables/create/biography_data.m4 index b0dacd3..2cb44d5 100644 --- a/db/schemas/sokwedb/tables/create/biography_data.m4 +++ b/db/schemas/sokwedb/tables/create/biography_data.m4 @@ -64,8 +64,9 @@ CREATE TABLE biography_data ( OR sex = 'sdb_unk_sex') ,animid_type_column(`momid', `MomID', `NULL') ,animid_type_column(`dadid', `DadID', `NULL') - ,dadprelim BOOLEAN - null_iff_null(`DadPrelim', `DadID') + ,dadstatus TEXT + REFERENCES dad_statuses + null_iff_null(`DadStatus', `DadID') ,dadidpub TEXT emptytext_check(`DadIDPub') null_iff_null(`DadIDPub', `DadID') diff --git a/db/schemas/sokwedb/views/create/biography.m4 b/db/schemas/sokwedb/views/create/biography.m4 index a4a77fe..236ccb7 100644 --- a/db/schemas/sokwedb/views/create/biography.m4 +++ b/db/schemas/sokwedb/views/create/biography.m4 @@ -52,7 +52,7 @@ CREATE OR REPLACE VIEW biography ( ,biography_data.sex ,biography_data.momid ,CASE - WHEN biography_data.dadprelim + WHEN biography_data.dadstatus = 'sdb_dad_prelim' THEN biography_data.dadid || '_prelim' ELSE biography_data.dadid END CASE diff --git a/doc/src/code_tables.m4 b/doc/src/code_tables.m4 index 0db93e5..0a8e27f 100644 --- a/doc/src/code_tables.m4 +++ b/doc/src/code_tables.m4 @@ -444,7 +444,8 @@ DAD_STATUSES (Dad ID Statuses) Special Values `````````````` -None. +The |DAD_STATUSES.Status| value of ``sdb_dad_prelim`` indicates that +the paternity assignment is preliminary. Column Descriptions diff --git a/doc/src/epilog.inc.m4 b/doc/src/epilog.inc.m4 index 04a3024..1078c7c 100644 --- a/doc/src/epilog.inc.m4 +++ b/doc/src/epilog.inc.m4 @@ -91,8 +91,8 @@ sdb_generated_rst()dnl :ref:`MomID ` .. |BIOGRAPHY_DATA.DadID| replace:: :ref:`DadID ` -.. |BIOGRAPHY_DATA.DadPrelim| replace:: - :ref:`DadPrelim ` +.. |BIOGRAPHY_DATA.DadStatus| replace:: + :ref:`DadStatus ` .. |BIOGRAPHY_DATA.DadIDPub| replace:: :ref:`DadIDPub ` .. |BIOGRAPHY_DATA.FirstBorn| replace:: diff --git a/doc/src/tables/biography_data.m4 b/doc/src/tables/biography_data.m4 index 1bc03e2..e5b6509 100644 --- a/doc/src/tables/biography_data.m4 +++ b/doc/src/tables/biography_data.m4 @@ -83,7 +83,7 @@ individuals, one with a |BIOGRAPHY_DATA.AnimID| of one of: ``sdb_unk``, ``sdb_stranger_male``, ``sdb_stranger_female``, ``sdb_stranger_female2``, or ``sdb_stranger_female3``. -sdb_null_iff_null(*m4[|BIOGRAPHY_DATA.DadPrelim|]m4*,*m4[|BIOGRAPHY_DATA.DadID|]m4*) +sdb_null_iff_null(*m4[|BIOGRAPHY_DATA.DadStatus|]m4*,*m4[|BIOGRAPHY_DATA.DadID|]m4*) sdb_null_iff_null(*m4[|BIOGRAPHY_DATA.DadIDPub|]m4*,*m4[|BIOGRAPHY_DATA.DadID|]m4*) The row defining the unknown individual, the ``BIOGRAPHY_DATA`` row having @@ -194,15 +194,16 @@ DadID (Father's AnimID) |allownull| -.. _BIOGRAPHY_DATA.DadPrelim: +.. _BIOGRAPHY_DATA.DadStatus: -DadPrelim (Is Paternity Preliminary?) -`````````````````````````````````````` +DadStatus +````````` -.. |BIOGRAPHY_DATA.DadPrelim_summary| replace:: - A boolean value. When |true|, the paternity assignment is preliminary. +.. |BIOGRAPHY_DATA.DadStatus_summary| replace:: + A code indicating the status of the paternity assignment. + A |DAD_STATUSES|.\ |DAD_STATUSES.Status| value. -|BIOGRAPHY_DATA.DadPrelim_summary| |allownull| +|BIOGRAPHY_DATA.DadStatus_summary| |allownull| .. _BIOGRAPHY_DATA.DadIDPub: diff --git a/doc/src/views/biography.m4 b/doc/src/views/biography.m4 index 8d423c6..8d09586 100644 --- a/doc/src/views/biography.m4 +++ b/doc/src/views/biography.m4 @@ -77,7 +77,8 @@ Columns in the BIOGRAPHY View | MomID | |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.MomID| | |BIOGRAPHY_DATA.AnimID| of the individual's mother | +-------------+-------------------------------------------------+---------------------------------------------------------------------+ | DadID || |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.DadID| | |BIOGRAPHY_DATA.AnimID| of the individual's father, | - | || |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.DadPrelim| | suffixed with ``_prelim`` if |BIOGRAPHY_DATA.DadPrelim| is |TRUE| | + | || |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.DadStatus| | suffixed with ``_prelim`` if |BIOGRAPHY_DATA.DadStatus| | + | || | is ``sdb_dad_prelim`` | +-------------+-------------------------------------------------+---------------------------------------------------------------------+ | DadIDPub | |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.DadIDPub| | Publication of Paternity citation | +-------------+-------------------------------------------------+---------------------------------------------------------------------+ diff --git a/include/global_constants.m4 b/include/global_constants.m4 index e55bba8..7faab72 100644 --- a/include/global_constants.m4 +++ b/include/global_constants.m4 @@ -95,6 +95,12 @@ dnl dnl The unknown community define(`sdb_unknown_comm', `Unknown') +dnl +dnl DAD_STATUSES +dnl +dnl The code indicating that the paternity is "preliminary" +define(`sdb_dad_prelim', `Prelim') + dnl dnl EVENTS dnl -- 2.34.1